Send view focus events and handle focus change requests - #188
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4d4745091e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| flutter::FlutterTizenEngine* tizen_engine = EngineFromHandle(engine); | ||
| tizen_engine->lifecycle_channel()->AppIsResumed(); | ||
| if (tizen_engine->view()) { | ||
| tizen_engine->view()->OnFocus(kFocused); |
There was a problem hiding this comment.
Preserve focus-skip windows as unfocused
When FlutterDesktopWindowProperties.focusable is false, TizenWindowEcoreWl2::SetWindowOptions marks the native window with ecore_wl2_window_focus_skip_set(..., EINA_TRUE), so the app can resume while this view is intentionally unable to receive platform focus. This unconditional kFocused event makes PlatformDispatcher.onViewFocusChange report focus for those overlay/background windows even though native key focus remains elsewhere; gate this on the window's actual/focusable state rather than app resume alone.
Useful? React with 👍 / 👎.
The engine's view-focus embedder API (FlutterEngineSendViewFocusEvent, view_focus_change_request_callback) is declared in embedder.h but was never wired up, so PlatformDispatcher.onViewFocusChange and requestViewFocusChange did not work on Tizen. Since the embedder has no native window focus event handler, the app lifecycle is used as a proxy for view focus: kFocused is sent to the engine when the app is resumed, and kUnfocused when it becomes inactive or paused. Focus change requests from the framework are handled by activating the window. Windows created with focusable = false are marked with ecore_wl2_window_focus_skip_set and can never receive native key focus, so kFocused events and window activation are skipped for them. Fixes flutter-tizen#187
#187